package testGroovy;

import java.text.SimpleDateFormat
import static java.time.LocalDate.now as today

def date = '2015-03-01' 
SimpleDateFormat dateFormat = new SimpleDateFormat('yyyy-MM-dd')
println dateFormat.parse(date).format( 'yyyy-MM-dd' )
println new SimpleDateFormat('yyyy-MM-dd').with {
	parse(date).format( 'yyyy-MM-dd' )
}

def commecialStartDate = new SimpleDateFormat('yyyy-MM-dd').with {
	format(new Date())
} + ' 00:00:00'
println commecialStartDate

def commecialEndDate = new SimpleDateFormat('yyyy-MM-dd').with {
	format(new Date().with {
		setYear(Calendar.getInstance().get(Calendar.YEAR) - 1900 + 1)
		it
	})
} + ' 00:00:00'
println commecialEndDate
Calendar calendar = Calendar.getInstance()
println calendar.get(Calendar.YEAR) + 1

def date1 = new Date().with {
	setYear(Calendar.getInstance().get(Calendar.YEAR) - 1900 + 1)
	it
}
println date1


def millis = Date.getMillisOf(new Date().with {
	setYear(calendar.get(Calendar.YEAR) - 1900 + 1)
	it
})
println millis

def today = today()
println today
println today.plusDays(1)
println java.sql.Date.valueOf(today.plusDays(1))
println java.sql.Date.valueOf(today.plusYears(1))

println '--------------------------'
def currentDate = today
def commecialStartDate1 =  currentDate.plusDays(1).toString() + ' 00:00:00'
def commecialEndDate1 = currentDate.plusYears(1).plusDays(1).toString() + ' 00:00:00'
def applicationDate = currentDate
def issueDate = currentDate
def startDate = currentDate.plusDays(1)

println commecialStartDate1
println commecialEndDate1
println applicationDate
println issueDate
println startDate